package msg

import (
	"lol.com/feb214-game/nest.git/leaf"
	"lol.com/feb214-game/nest.git/log"
	"lol.com/feb214-game/nest.git/tools/jsonutils"
)

func init() {
	p := leaf.MsgProcessor
	p.Register(&AuthReq{}, 211)
	p.Register(&BetReq{}, 212)
	p.Register(&BankerReq{}, 213)

	p.Register(&UserST{}, 1001)
	p.Register(&RoomST{}, 1002)
	p.Register(&StartBetNT{}, 1003)
	p.Register(&StopBetNT{}, 1004)
	p.Register(&AwardNT{}, 1005)
	p.Register(&UserBetEV{}, 1006)
	p.Register(&BankerST{}, 1007)
	p.Register(&TopPlayerST{}, 1008)
	p.Register(&BatchUserBetEV{}, 1009)
}

func (info *JmgST) PrettyString() string {
	obj := jsonutils.JsonObject{
		"WinIndex": info.WinIndex,
		"WinPrice": info.DiceIndex,
	}
	return string(*log.AnyObject(obj))
}

func (info *JmgST) PrettyJson() jsonutils.JsonObject {
	obj := jsonutils.JsonObject{
		"WinIndex": info.WinIndex,
		"WinBet":   info.DiceIndex,
	}
	return obj
}
